FIG. 1 shows an example of a construction of an encoding apparatus 1 according to a conventional technique.
A band splitter 11, formed of a filter such as a QMF (Quadrature Mirror Filter) or a PQF (Polyphase Quadrature Filter), splits input audio signal into plural (12, in this specific example) frequency bands and outputs resultant signals of respective bands (hereinafter, such signals will be referred to as encoding units) A0 to A11 (when it is not necessary to distinguish individual encoding units from each other, a simple expression “encoding unit A” will be employed. Similar simple expressions will also be used elsewhere in the present description) to respective spectrum converters 12-1 to 12-12 corresponding to the bands.
The band splitter 11 may split the signal into bands with an equal bandwidth or into critical bands whose bandwidth increases with frequency taking into account the characteristics of human ears.
The spectrum converters 12-1 to 12-12 divide the encoding units A0 to A11 received from the band splitter 11 into blocks (frames) with a fixed length (a fixed period of time), generate gain control information G0 to G11 (which will be described in detail later) depending on the amplitudes of the waveform signals of the respective blocks, and control the gains of the waveform signals of the respective blocks in accordance with the gain control information G0 to G11. The generated gain control information G0 to G11 are supplied from the spectrum converters 12-1 to 12-12 to a multiplexer 16.
After performing the gain control, the spectrum converters 12-1 to 12-12 perform spectrum conversions based on DFT (discrete Fourier transformation) or DCT (discrete cosine transformation) on the signals thereby generating spectral component signals S0 to S11. The resultant spectral component signals S0 to S11 are supplied to a quantization step size setting unit 14 and also to normalizers 13-1 to 13-12 of the respective bands.
The normalizers 13-1 to 13-12 normalize the spectral component signals S0 to S11 received from the spectrum converters 12-1 to 12-12.
More specifically, the normalizers 13-1 to 13-12 detect a signal component having a greatest absolute value from the spectral component signals S0 to S11 every unit of time and normalize the spectral component signals S0 to S11 by employing relative values of coefficients with respect to the detected greatest value as the normalized spectral component signals B0 to B11.
The normalizers 13-1 to 13-12 supply the calculated normalized coefficients B0 to B11 to the multiplexer 16 and supply normalized data C0 to C11 obtained by normalizing the spectral component signals S0 to S11 to respective quantizers 15-1 to 15-12 corresponding to the respective bands.
On the basis of the spectral component signals S0 to S11 received from the spectrum converters 12-1 to 12-12, the quantization step size setting unit 14 determines quantization step sizes to be used in quantization of the normalized data C0 to C11, and outputs quantization step size information D0 to D11 indicating the determined quantization step sizes to the corresponding quantizers 15-1 to 15-12. The quantization step size setting unit 14 also supplies the quantization step size information D0 to D11 to the multiplexer 16.
The quantizers 15-1 to 15-12 quantize the normalized data C0 to C11 supplied every unit of time from the normalizers 13-1 to 13-12, by employing quantization step sized specified by the quantization step size information D0 to D11 received from the quantization step size setting unit 14. Resultant quantized coefficients F0 to F11 (quantized coefficients F of one frame) obtained via the quantization are supplied to the multiplexer 16.
The multiplexer 16 encodes the gain control information G0 to G11 received from the spectrum converter 12, the normalized coefficients B0 to B11 received from the normalizer 13, the quantization step size information D0 to D11 received from the quantization step size setting unit 14, and the quantized coefficients F0 to F11 received from the quantizer 15, on a frame-by-frame basis.
For example, as shown in FIG. 2, encoded data of an (L−1)th frame and encoded data of an Lth frame each include encoded gain control information G0 to G11, normalized coefficients B0 to B11, quantization step size information D0 to D11, and quantized coefficients F0 to F11.
FIG. 3 shows an example of a construction of the spectrum converter 12.
A windowing unit 21 divides an encoding unit A received from the band splitter 11 into blocks having a fixed length (a fixed period of time) and each blocks is multiplied by a window conversion function. More precisely, the windowing unit 21 applies the window conversion function for a range including one block and portions of temporally adjacent blocks. As a result, a waveform signal such as that shown in FIG. 4A or 4B is generated. The windowing unit 21 supplies the resultant waveform signal to a detector 22.
The detector 22 determines whether the waveform signal received from the windowing unit 21 includes an attack portion AT or a release portion RE, on a block-by-block basis. If it is determined that the waveform signal includes an attack portion AT or a release portion RE, the detector 22 generates a detection flag indicating that the waveform signal includes an attack portion AT or a release portion RE.
The attack portion AT refers to a portion in which the level of the waveform signal increases abruptly, and the release portion RE refers to a portion in which the level decreases abruptly, as shown in FIG. 4A or 4B.
If an attack portion AT or a release portion RE is detected in a waveform signal of a block, the detector 22 generates a detection flag indicating that the waveform signal includes an attack portion AT or a release portion RE. In this case, the detector 22 also generates gain control amount information indicating a gain control amount depending on the level of a low-level signal preceding the attack portion AT (hereinafter, such a low-level signal will be referred to as a semi stationary portion SS) or depending on the level of the release portion RE, gain control position information indicating a position at which gain control is to be performed by the gain control amount, and the number of portions to be subjected to the gain control (hereinafter, such a number of portions will be referred to as a gain control number).
For example, when a waveform signal such as that shown in FIG. 4A or 4B is input, the detector 22 generates a detection flag indicating that the signal includes an attack portion AT or a release portion RE and also generates first gain control amount information indicating the gain control amount corresponding to the level of the semi stationary portion SS, second gain control amount information indicating the gain control amount corresponding to the level of the release portion, first gain control position information indicating a position at which gain control is to be performed by the gain control amount indicated by the first gain control amount information, second gain control position information indicating a position at which gain control is to be performed by the gain control amount indicated by the second gain control amount information, and a gain control number indicating that gain control is to be performed at two positions.
For example, in a case in which the gain control amount of the release portion RE is set to 1, the gain control amount information associated with the semi stationary portion SS shown in FIG. 4A indicates a relatively small gain control amount (SSa), as shown in FIG. 4C, because the noise levels of the semi stationary portion SS and the release portion RE are relatively high.
On the other hand the gain control amount information associated with the waveform signal shown in FIG. 4B indicates a relatively large gain control amount (SSb), as shown in FIG. 4C, because the noise levels of the semi stationary portion SS and the release portion RE are relatively low.
In the case in which the waveform signal of a block includes an attack portion AT or a release portion RE, a detection flag indicating that the waveform signal includes an attack portion AT or a release portion RE, gain control amount information, gain control position information, and a gain control number are generated by the detector 22 and supplied to a controller 23 together with the waveform signal output from the windowing unit 21. In a case in which a waveform signal of a block includes neither an attack portion AT nor a release portion RE, the detector 22 outputs to the controller 23 a detection flag indicating that the waveform signal includes neither attack portion AT nor a release portion RE, together with the waveform signal received from the windowing unit 21.
In the case in which the detection flag indicates that the waveform signal includes an attack portion AT or a release portion RE, the controller 23 controls the gain of the waveform signal of the block in accordance with the gain control number, the gain control amount information, and the gain control position information, which were supplied together with the detection flag. The signal obtained via the gain control process is supplied to a spectrum converter 24 from the controller 23.
For example, in the case of the waveform signal shown in FIG. 4A, the waveform signal is multiplied by a gain control function A shown in FIG. 4C. In the case of the waveform signal shown in FIG. 4B, the waveform signal is multiplied by a gain control function B shown in FIG. 4C.
In the case in which the detection flag indicates that the waveform signal includes neither an attack portion AT or a release portion RE, the controller 23 does not substantially perform the gain control on the waveform signal of the block received from the detector 22 but directly supplies the waveform signal to the spectrum converter 24.
When the controller 23 receives, in addition to a detection flag, a gain control number, gain control amount information, and gain control position information from the detector 22, the controller 23 supplies the received data as gain control information G to the multiplexer 16. However, in the case in which a gain control number, gain control amount information, and gain control position information were not supplied, the controller 23 outputs, to the multiplexer 16, gain control information G including only the detection flag indicating that the waveform signal includes neither an attack portion AT nor a release portion RE.
In the case in which the gain control information G received from the controller 23 of the spectrum converter 12 includes only a detection flag, the multiplexer 16 encodes and multiplexes only the detection flag as the gain control information G, as is the case with the encoded data of the (L−1)th frame shown in FIG. 2.
However, in the case in which the gain control information G received from the controller 23 includes not only a detection flag but also a gain control number, gain control amount information, and gain control position information, the multiplexer 16 encodes and multiplexes the detection flag, the gain control number, the gain control amount information, and the gain control position information, as the gain control information G, as is the case with the encoded data of the Lth frame shown in FIG. 2.
Referring again to FIG. 3, the spectrum converter 24 performs a spectrum conversion based on DFT, DCT, or MDCT on the signal received from the controller 23. A resultant spectral component signal S obtained via the spectrum conversion is supplied to the normalizer 13.
FIG. 5 shows an example of a construction of a decoding apparatus 2 for decoding the encoded data generated by the encoding apparatus 1 shown in FIG. 1.
A demultiplexer 31 decodes the encoded data supplied from the encoding apparatus 1 shown in FIG. 1 and separates the decoded data into gain control information G0 to G11, normalized coefficients B0 to B11, quantization step size information D0 to D11, and quantized coefficients F0 to F11.
The separated normalized coefficients B0 to B11, quantization step size information D0 to D11, and quantized coefficients F0 to F11 are supplied from the demultiplexer 31 to corresponding dequantizers/denormalizers 32-1 to 32-12, while the gain control information G0 to G11 are supplied to corresponding inverse spectrum converters 33-1 to 33-12.
The dequantizer/denormalizer 32 dequantizes the quantized coefficients F by employing a quantization step size corresponding to that indicated by the quantization step size information D and multiplies the normalized data C obtained via the dequantization by a value corresponding to the normalized coefficient B (thereby denormalizing the normalized data C). The signal obtained as a result of the above process is supplied to the inverse spectrum converter 33.
The inverse spectrum converter 33 performs an inverse spectrum conversion which is an inverse transformation of the spectrum conversion performed by the encoding apparatus 1.
In accordance with the gain control information G, the inverse spectrum converter 33 performs a gain control adjustment on the signal obtained via the inverse spectrum conversion and the inverse spectrum converter 33 outputs resultant encoding units A to a band combiner 34.
The band combiner 34 combines the encoding units A received from the inverse spectrum converter 33 such that overlapped sample data of the block are interfered with each other, thereby reconstructing an audio signal.
FIG. 6 shows an example of a construction of the inverse spectrum converter 33.
An inverse spectrum converter 41 performs an inverse spectrum conversion, which is an inverse transformation of the spectrum conversion performed by the encoding apparatus 1, on the data output from the dequantizer/denormalizer 32.
More specifically, in a case in which the spectrum conversion is performed by the encoding apparatus 1 on the basis of DFT, the inverse spectrum conversion is performed on the basis of IDFT. In a case in which the spectrum conversion is performed by the encoding apparatus 1 on the basis of DCT, the inverse spectrum conversion is performed on the basis of IDCT.
The adjusting unit 42 performs a gain control adjustment on the signal received from the inverse spectrum converter 41, in accordance with the gain control information G supplied from the demultiplexer 31.
More specifically, when the detection flag included in the gain control information G indicates the presence of an attack portion AT or a release portion RE, the adjusting unit 42 performs the gain control adjustment on the signal received from the inverse spectrum converter 41, in accordance with the gain control number, the gain control position information, and the gain control amount information That is, the signal output from the inverse spectrum converter 41 is multiplied by the a gain control adjustment function corresponding to the gain control function employed in the encoding process.
For example, in the case of a waveform signal shown in FIG. 4A, when the encoding apparatus 1 controlled the gain thereof, a gain control function A having relatively small gain control amounts as shown in FIG. 4C was employed. Therefore, in the gain control adjustment for the signal obtained by dequantizing and denormalizing the encoded data of the waveform signal shown in FIG. 4A, the signal is multiplied by a gain control adjustment function having relatively small gain control amounts.
Thus, in this case, as can be seen from FIG. 4D, although noise suppression for the semi stationary portion SS and the release portion RE is relatively low, quantization noise energy is suppressed to a low level over the entire block.
On the other hand, in the case of a waveform signal shown in FIG. 4B, when the encoding apparatus 1 controlled the gain thereof, a gain control function B having relatively large gain control amounts as shown in FIG. 4C was employed. Therefore, in the gain control adjustment for the signal obtained by dequantizing and denormalizing the encoded data of the waveform signal shown in FIG. 4B, the signal is multiplied by a gain control adjustment function having relatively large gain control amounts.
Thus, in this case, as can be seen from FIG. 4E, although the attack portion AT in the block includes relatively large quantization noise energy, quantization noise is suppressed to low levels for both the semi stationary portion SS and the release portion RE.
Therefore, a pre-echo or post-echo problem in hearing the waveform signal such as that shown in FIG. 4A or 4B is suppressed.
On the other hand, in the case in which the detection flag indicates that there is neither an attack portion AT nor a release portion RE, the adjusting unit 42 does not substantially perform the signal attenuating process on the signal received from the inverse spectrum converter 41.
The manner of encoding and decoding an audio signal has been described above.
In the case in which a waveform signal in a frame includes an attack portion AT or a release portion RE, the encoding apparatus 1 also encodes gain control information G including gain control number, gain control position information and gain control amount information in addition to a detection flag. In the conventional technique, for example, the gain control number, the gain control position information, and the gain control amount information are encoded into 3-bit, 4-bit, and 5-bit codes, respectively.
Because the total data size of encoded data of a frame is generally fixed, encoding of the gain control number, the gain control position information, and the gain control amount information into such fixed-length codes results in a limitation on the number of bits available for encoding of quantized coefficients F and thus results in a reduction in the encoding efficiency of the quantized coefficients F.